package cn.getech.data.development.entity.permission;

import cn.getech.data.development.entity.flink.BdpRealTableField;
import cn.getech.data.development.entity.flink.BdpRealTableInfo;
import lombok.Data;

import java.util.List;

/**
 * @description: 实时表权限
 * @author: wangzhaowen：kiss
 * @create: 2020/7/31 14:26
 * @version: 2020/7/31
 **/
@Data
public class RealTablePermission extends SysRoleDataPermission {



   /**
    * 表名称
    */
   private String chName;

   /**
    * 英文名称
    */
   private String enName;


   private List<RealTableFieldInfoPermission> tableFieldInfos;

    /**
     * 表密级信息
     */
    private String levelName;

    public RealTablePermission( ) {
    }

    public RealTablePermission(BdpRealTableInfo record, SysRoleDataPermission sysRoleDataPermission) {
        if (record != null) {
            setEnName(record.getTableName());
            setLevelName(record.getLevelName());
            setDataId(record.getId());
        }
        if (sysRoleDataPermission != null) {
            setQuery(sysRoleDataPermission.getQuery());
            setCreate(sysRoleDataPermission.getCreate());
            setUpdate(sysRoleDataPermission.getUpdate());
            setDelete(sysRoleDataPermission.getDelete());
            setAssign(sysRoleDataPermission.getAssign());
            setDecrypt(sysRoleDataPermission.getDecrypt());
            setExport(sysRoleDataPermission.getExport());
            setRoleId(sysRoleDataPermission.getRoleId());
            setDataType(sysRoleDataPermission.getDataType());
            setId(sysRoleDataPermission.getId());
            setWrite(sysRoleDataPermission.getWrite());
        }
    }


}
